package com.develop.wechatpay.controller;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.develop.wechatpay.service.KingdeeK3CloudService;
import com.develop.wechatpay.service.WeChatPayOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

//@RestController
//@RequestMapping("/k3cloud")
public class KingdeeK3CloudController {

    @Autowired
    private KingdeeK3CloudService kingdeeK3CloudService;

    @PostMapping("/loginByAppSecret")
    public JSONObject loginByAppSecret(@RequestBody JSONArray array) throws Exception {
        return kingdeeK3CloudService.loginByAppSecret(array);
    }

    @PostMapping("/sendPostRequest/{apiUrl}")
    public JSONObject loginByAppSecret(@PathVariable String apiUrl, @RequestBody JSONArray array) throws Exception {
        return kingdeeK3CloudService.sendPostRequest(apiUrl, array);
    }


}
